﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using CoVanHocTapData.Interface;
using CoVanHocTapData.Entities;

namespace CoVanHocTapData.Concretes
{
    public class NganhHoc2Repository : INganhHoc2Repository
    {
        DangKyPhuEntities entities;
        public NganhHoc2Repository()
        {
            entities = new DangKyPhuEntities();
        }

        public string NganhHoc2CuaSinhVien(string maSV)
        {
            var nganh = (from m in entities.NganhHoc2
                         where m.MSSV.Equals(maSV)
                         select m.NganhID).FirstOrDefault();
            return nganh;
        }


        public bool CoHocChuyenNganh2(string maSV)
        {
            if ((from m in entities.NganhHoc2 where m.MSSV.Equals(maSV) select m).Count() > 0)
                return true;
            return false;
        }
    }
}
